/*
 * ExternalModelElement.java
 * 
 * Created on Aug 18, 2007, 8:47:14 PM
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.usixml.model.imports;

import org.usixml.model.ModelElement;

/**
 *
 * @author htmfilho
 */
public abstract class ExternalModelElement implements ModelElement {

    private String id = null;
    
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }
    
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || !(object instanceof ModelElement)) return false;

        ModelElement other = (ModelElement)object;

        if (id == null) return false;

        return id.equals(other.getId());
    }
    
    public int hashCode() {
        if (id != null)
            return id.hashCode();
        else
            return super.hashCode();
    }
}
